#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stack>
#include <list>
#include <string>

using namespace std;

void Test1()
{
	string s1("Hello Wrold");
	string s2(s1);
	string s3(s2, 3, 5);
	string s4(s2, 3);

	string::iterator it1 = s1.begin();

	cout << "while it1: ";
	while (it1 != s1.end())
	{
		cout << *it1 << " ";
		it1++;
	}
	cout << endl;

	cout << "for auto: ";
	for (auto e : s1)
	{
		cout << e << " ";
	}
	cout << endl;

	cout << "s1.size():" << s1.size() << endl;
	cout << "s1.length():" << s1.length() << endl;
	cout << "s1.capacity:" << s1.capacity() << endl;

	s1.push_back('a');
	s2.append("abcd");
	cout << "s1: " << s1 << endl;
	cout << "s2: " << s2 << endl;
}

void Test2()
{
	string s1("Hello World");
	cout << s1 << endl;

	s1.clear();
	cout << "clear: " << s1 << endl;

}

int main()
{
	Test2();
	return 0;
}